from io import StringIO
f = StringIO()
f.write('hellow')
f.write(' ')
f.write('world!')
print(f.getvalue())